class Person:
    pass


class Student(Person):
    pass


class Teacher(Person):
    pass


class Worker(Person):
    pass


class Factory:
    def get_person(self, p_type):
        if p_type == 's':
            return Student()
        elif p_type == 't':
            return Teacher()
        else:
            return Worker()


f = Factory()
p1 = f.get_person('s')
p2 = f.get_person('t')
p3 = f.get_person('a')

print(type(p1))
print(type(p2))
print(type(p3))
